/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controldepuntos.pantallas;

import controldepuntos.clases.AdministradorVentanas;
import controldepuntos.clases.TcReglamento;
import controldepuntos.clases.Utilidades;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.util.ArrayList;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;

/**
 *
 * @author DIANA
 */
public class ARCatalogoFalta extends javax.swing.JFrame {

    /**
     * Creates new form Reglamento
     */
    Object idSeleccionado=0;
    int filaSeleccionada=0;
    public ARCatalogoFalta() {
        initComponents();
        cargaCatalogoReglamento();
    }
    public void cargaCatalogoReglamento(){
        try{
            //Impedir modificación directa de celdas
            DefaultTableModel model = new DefaultTableModel(){ 
            public boolean isCellEditable(int rowIndex,int columnIndex){return false;} };
            
            TcReglamento tcReglamento = new TcReglamento();
            ResultSet rs = tcReglamento.getReglamentoListResultSet();
            ResultSetMetaData rsmd = rs.getMetaData();
            int numeroDeColumnas = rsmd.getColumnCount();
            for(int i=1;i<=numeroDeColumnas;i++){
                model.addColumn(rsmd.getColumnLabel(i));
            }
            while(rs.next()){
                Object[] fila = new Object[numeroDeColumnas];
               for(int i=0;i<numeroDeColumnas;i++){
                   fila[i]=rs.getObject(i+1);
               }
               model.addRow(fila);
            }
            tblReglamento.setModel(model);
            //Ocultar fila Id
            tblReglamento.getColumnModel().getColumn(0).setMaxWidth(0);
            tblReglamento.getColumnModel().getColumn(0).setMinWidth(0);
            tblReglamento.getTableHeader().getColumnModel().getColumn(0).setMinWidth(0);
            tblReglamento.getTableHeader().getColumnModel().getColumn(0).setMaxWidth(0);
            
        }catch(Exception ex){
            JOptionPane.showMessageDialog(null, ex.getMessage());
        }
        
    }
    public boolean validarCampos(){
        try{
            boolean avanzar=true;
            if(cmbAccion.getSelectedIndex()==0){
                JOptionPane.showMessageDialog(this, "El campo Acción no debe ir vacío. \n Por favor llene este campo","Error",JOptionPane.ERROR_MESSAGE);
                avanzar=false;
            }else{
                  if((Integer)idSeleccionado!=0){
                    if(txtDescripcion.getText().isEmpty()){
                        JOptionPane.showMessageDialog(this, "El campo Descripción no debe ir vacío. \n Por favor llene este campo","Error",JOptionPane.ERROR_MESSAGE);
                        avanzar=false;
                    }else{
                        if(Integer.parseInt(txtPuntaje.getText())==0){
                            JOptionPane.showMessageDialog(this, "El campo Puntaje no debe ir vacío y debe contener solo números. \n Por favor llene este campo","Error",JOptionPane.ERROR_MESSAGE);
                            avanzar=false;
                        }
                    }
                }
            }
            return avanzar;
        }
        catch(NumberFormatException ex){
            JOptionPane.showMessageDialog(this, "El campo Puntaje no debe ir vacío y debe contener solo números. \n Por favor llene este campo","Error: "+ex.getMessage(),JOptionPane.ERROR_MESSAGE);
            return false;
        }
        catch(Exception ex){
            JOptionPane.showMessageDialog(this, "Error al validar los campos. \n Por favor contrate al administrador del sistema","Error: "+ex.getMessage(),JOptionPane.ERROR_MESSAGE);
            return false;
        }
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tblReglamento = new javax.swing.JTable();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        txtDescripcion = new javax.swing.JTextField();
        txtPuntaje = new javax.swing.JTextField();
        cmbAccion = new javax.swing.JComboBox();
        jLabel6 = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        txtDetalles = new javax.swing.JTextArea();
        jLabel5 = new javax.swing.JLabel();
        jButton3 = new javax.swing.JButton();
        jLabel4 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setResizable(false);

        jPanel1.setBackground(new java.awt.Color(204, 204, 204));

        tblReglamento.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        tblReglamento.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        tblReglamento.setName("tblCatalogo"); // NOI18N
        tblReglamento.setSelectionBackground(new java.awt.Color(255, 0, 0));
        tblReglamento.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tblReglamentoMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(tblReglamento);

        jButton1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/controldepuntos/recursos/guardar.jpg"))); // NOI18N
        jButton1.setText("Guardar cambios");
        jButton1.setName("btnGS"); // NOI18N
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jButton2.setText("MENÚ");
        jButton2.setName("btnSalir"); // NOI18N
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel1.setText("Descripción:");
        jLabel1.setName("lblFalta"); // NOI18N

        jLabel2.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel2.setText("Puntaje:");
        jLabel2.setName("lblPuntaje"); // NOI18N

        txtDescripcion.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        txtDescripcion.setName("txtDescripcion"); // NOI18N
        txtDescripcion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtDescripcionActionPerformed(evt);
            }
        });
        txtDescripcion.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txtDescripcionKeyTyped(evt);
            }
        });

        txtPuntaje.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        txtPuntaje.setName("txtPuntaje"); // NOI18N
        txtPuntaje.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtPuntajeActionPerformed(evt);
            }
        });
        txtPuntaje.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txtPuntajeKeyTyped(evt);
            }
        });

        cmbAccion.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        cmbAccion.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "--Seleccione--", "Agregar", "Modificar" }));
        cmbAccion.setName("cmbAccion"); // NOI18N
        cmbAccion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cmbAccionActionPerformed(evt);
            }
        });

        jLabel6.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel6.setText("Acción:");

        txtDetalles.setColumns(20);
        txtDetalles.setRows(5);
        txtDetalles.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txtDetallesKeyTyped(evt);
            }
        });
        jScrollPane2.setViewportView(txtDetalles);

        jLabel5.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel5.setText("Detalles:");

        jButton3.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/controldepuntos/recursos/bote.jpg"))); // NOI18N
        jButton3.setText("Eliminar elemento seleccionado");
        jButton3.setName("btnEliminar"); // NOI18N
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/controldepuntos/recursos/LogoSIAPPSuperChico.jpg"))); // NOI18N

        jLabel7.setFont(new java.awt.Font("Tahoma", 0, 36)); // NOI18N
        jLabel7.setText("Reglamento ");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(20, 20, 20)
                        .addComponent(jLabel1)
                        .addGap(5, 5, 5)
                        .addComponent(txtDescripcion, javax.swing.GroupLayout.PREFERRED_SIZE, 262, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addGap(39, 39, 39)
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                        .addComponent(jLabel5)
                                        .addComponent(jLabel2))
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel1Layout.createSequentialGroup()
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(txtPuntaje, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(jPanel1Layout.createSequentialGroup()
                                            .addGap(49, 49, 49)
                                            .addComponent(jButton1))
                                        .addGroup(jPanel1Layout.createSequentialGroup()
                                            .addGap(10, 10, 10)
                                            .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 260, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                    .addGap(0, 0, Short.MAX_VALUE))
                                .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addGap(50, 50, 50)
                                    .addComponent(jLabel6)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(cmbAccion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jButton3))
                                .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addGap(40, 40, 40)
                                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 760, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addGap(320, 320, 320)
                            .addComponent(jLabel7)
                            .addGap(260, 260, 260)
                            .addComponent(jLabel4))))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel7)
                    .addComponent(jLabel4))
                .addGap(26, 26, 26)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(15, 15, 15)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel6)
                        .addComponent(cmbAccion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jButton3))
                .addGap(7, 7, 7)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1)
                    .addComponent(txtDescripcion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel5)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(2, 2, 2)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtPuntaje, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 21, Short.MAX_VALUE)
                        .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(32, 32, 32)
                        .addComponent(jButton1)))
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void txtDescripcionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtDescripcionActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtDescripcionActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
            if(validarCampos()){
                if(cmbAccion.getSelectedItem().toString().equals("Agregar")){    
                        TcReglamento nuevoReglamento = new TcReglamento();
                        nuevoReglamento.setDescripcion(txtDescripcion.getText());
                        nuevoReglamento.setDetalles(txtDetalles.getText());
                        nuevoReglamento.setPuntos(Integer.parseInt(txtPuntaje.getText()));
                        nuevoReglamento.insertarReglamento(nuevoReglamento);

                }
                if(cmbAccion.getSelectedItem().toString().equals("Modificar")){
                    if((Integer)idSeleccionado==0){
                        JOptionPane.showMessageDialog(this, "Debe seleccionar un elemento de la tabla","Error",JOptionPane.ERROR_MESSAGE);
                    }else{
                        TcReglamento modificarReglamento = new TcReglamento();
                        modificarReglamento.setIdReglamento(Integer.parseInt(idSeleccionado.toString()));
                        modificarReglamento.setDescripcion(txtDescripcion.getText());
                        modificarReglamento.setDetalles(txtDetalles.getText());
                        modificarReglamento.setPuntos(Integer.parseInt(txtPuntaje.getText()));
                        modificarReglamento.modificarReglamento(modificarReglamento);
                    }

                }
            }
        
    }//GEN-LAST:event_jButton1ActionPerformed

    private void tblReglamentoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblReglamentoMouseClicked
        try{
            filaSeleccionada=this.tblReglamento.getSelectedRow();
            idSeleccionado=tblReglamento.getModel().getValueAt(filaSeleccionada, 0);
            //JOptionPane.showMessageDialog(null, idSeleccionado.toString());
            TcReglamento reglamentoEncontrado = new TcReglamento();
            reglamentoEncontrado = reglamentoEncontrado.seleccionarPorId(idSeleccionado.toString());
            //JOptionPane.showMessageDialog(rootPane, idSeleccionado.toString());
            //JOptionPane.showMessageDialog(rootPane, "Puntos......"+reglamentoEncontrado.getPuntos());
            txtDescripcion.setText(reglamentoEncontrado.getDescripcion());
            txtDetalles.setText(reglamentoEncontrado.getDetalles());
            txtPuntaje.setText(String.valueOf(reglamentoEncontrado.getPuntos()));
        }catch(Exception ex){
            JOptionPane.showMessageDialog(null, "Lo sentimos, Ocurrió un error. ARCatalogoFalta.jTable1MouseClicked"+ex.getMessage());
        }
    }//GEN-LAST:event_tblReglamentoMouseClicked

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        try{
            if(idSeleccionado!=null){
                 if(JOptionPane.showConfirmDialog(AdministradorVentanas.pantallaCatalogoFalta,"¿Está seguro de querer eliminar el elemento seleccionado?")==JOptionPane.YES_OPTION){
                    TcReglamento reglamentoAEliminar = new TcReglamento();
                    reglamentoAEliminar.setIdReglamento(Integer.parseInt(idSeleccionado.toString()));
                    reglamentoAEliminar.eliminarReglamento(reglamentoAEliminar);
                 }
            }
        }catch(Exception ex){
            JOptionPane.showMessageDialog(AdministradorVentanas.pantallaCatalogoFalta, "Debe seleccionar un elemento de la tabla","Error",JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        AdministradorVentanas.mostrarPantallaMenu();
        AdministradorVentanas.ocultarPantallaCatalogoFalta();
    }//GEN-LAST:event_jButton2ActionPerformed

    private void cmbAccionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmbAccionActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_cmbAccionActionPerformed

    private void txtPuntajeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtPuntajeActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtPuntajeActionPerformed

    private void txtDescripcionKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtDescripcionKeyTyped
       Utilidades.establecerLongitudMaxima(txtDescripcion, evt, 50);
    }//GEN-LAST:event_txtDescripcionKeyTyped

    private void txtDetallesKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtDetallesKeyTyped
        Utilidades.establecerLongitudMaxima(txtDetalles, evt, 200);
    }//GEN-LAST:event_txtDetallesKeyTyped

    private void txtPuntajeKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtPuntajeKeyTyped
        Utilidades.establecerLongitudMaxima(txtPuntaje, evt, 2);
    }//GEN-LAST:event_txtPuntajeKeyTyped

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(ARCatalogoFalta.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(ARCatalogoFalta.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(ARCatalogoFalta.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(ARCatalogoFalta.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new ARCatalogoFalta().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JComboBox cmbAccion;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JTable tblReglamento;
    private javax.swing.JTextField txtDescripcion;
    private javax.swing.JTextArea txtDetalles;
    private javax.swing.JTextField txtPuntaje;
    // End of variables declaration//GEN-END:variables
}
